<?php
$object_type = isset($object_type) ? $object_type : '';
$width = isset($width) ? $width : (isset($pair->image->image_x) ? $pair->image->image_x : 100);
$height = isset($height) ? $height : (isset($pair->image->image_y) ? $pair->image->image_y : 100);

if ( isset($pair->pair_id) && isset($pair->image_id) && isset($pair->image) ) {
//	$img = CHtml::image('/', '', array('id' => 'image_'.$object_type.'_'.$pair->pair_id, 'alt' => '', 'border' => 0));
	$img = img($object_type, $pair->image->image_path, '', array('id' => 'image_'.$object_type.'_'.$pair->pair_id, 'border' => 0), array('width' => $width, 'height' => $height));
	echo CHtml::link($img, '/', array('target' => '_blank')) ;
} else {
	echo img('product', 'no_image.png', '', array('id' => 'image_'.$object_type.'_'.rand(1000, 9999), 'border' => 0), array('width' => $width, 'height' => $height));
	//echo CHtml::image(bu() . '/images/no_image.gif', '', array('alt' => '', 'border' => 0));
}
?>